package v2;

/**
 * 类的适配器模式
 */
public class AdapterTest2 {
    public static void main(String[] args) {
        Adpater adpater = new Adpater();
        adpater.output5v();

    }
}
class Adaptee{
    private int output220v;
    public int output220v(){
        return 220;
    }
}

//目标电压接口
interface Target{
    int output5v();
}
class Adpater extends Adaptee implements Target{

    @Override
    public int output5v() {
        int i = output220v();
        System.out.println(String.format("原始电压：%d -> %d",i,5));
        return 5;
    }
}